import request from '@/utils/request'

// 节假日查询
export const getHolidayList = (params) => {
  return request({
    method: 'get',
    url: '/inspection/holiday/query',
    params,
  })
}

// 节假日同步
export const updateHoliday = (params) => {
  return request({
    method: 'post',
    url: '/inspection/holiday/sync',
    params: params,
  })
}

// 排班查询
export const getScheduleList = (params) => {
  return request({
    method: 'get',
    url: '/inspection/schedule/query',
    params,
  })
}

// 添加巡检计划
export const addSchedule = (data) => {
  return request({
    method: 'post',
    url: '/inspection/schedule/addOrUpdate',
    data,
  })
}

// 删除巡检计划
export const deleteSchedule = (params) => {
  return request({
    method: 'delete',
    url: `/inspection/schedule/delete`,
    params,
  })
}

// 导入
export const importSchedule = (data) => {
  return request({
    method: 'post',
    url: `/inspection/schedule/import`,
    data,
  })
}

// 导出
export const exportSchedule = (params) => {
  return request({
    method: 'get',
    url: `/inspection/schedule/export`,
    params,
    responseType: 'blob',
  })
}
